
import * as BASE from '../constants/baseTypes';
import {Actions} from "react-native-router-flux";
const initailState = {

    loadingStatus:false,
    msg_data:{}
};

export default function baseReducer(state = initailState, action) {
    switch (action.type) {
        case BASE.LOADING:
            return {
                ...state,
                loadingStatus: !state.loadingStatus
            };
        case BASE.RECIEVE_MSG:
            Actions.alert({msg:action.data});
            return {
                ...state,
                msg_data: action.data
            };
        default:
            return state;
    }
}